class SeminorsController < ApplicationController
  # GET /seminors
  # GET /seminors.xml
  def index
    @seminors = Seminor.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @seminors }
    end
  end

  # GET /seminors/1
  # GET /seminors/1.xml
  def show
    @seminor = Seminor.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @seminor }
    end
  end

  # GET /seminors/new
  # GET /seminors/new.xml
  def new
    @seminor = Seminor.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @seminor }
    end
  end

  # GET /seminors/1/edit
  def edit
    @seminor = Seminor.find(params[:id])
  end

  # POST /seminors
  # POST /seminors.xml
  def create
    @seminor = Seminor.new(params[:seminor])

    respond_to do |format|
      if @seminor.save
        flash[:notice] = 'Seminor was successfully created.'
        format.html { redirect_to(@seminor) }
        format.xml  { render :xml => @seminor, :status => :created, :location => @seminor }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @seminor.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /seminors/1
  # PUT /seminors/1.xml
  def update
    @seminor = Seminor.find(params[:id])

    respond_to do |format|
      if @seminor.update_attributes(params[:seminor])
        flash[:notice] = 'Seminor was successfully updated.'
        format.html { redirect_to(@seminor) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @seminor.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /seminors/1
  # DELETE /seminors/1.xml
  def destroy
    @seminor = Seminor.find(params[:id])
    @seminor.destroy

    respond_to do |format|
      format.html { redirect_to(seminors_url) }
      format.xml  { head :ok }
    end
  end
end
